﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="Label.aspx.cs" Inherits="TaobaoERP.Views.Product.Label" %>

<asp:Content ContentPlaceHolderID="HeaderPlaceHolder" ID="Header1" runat="server">

    <script type="text/javascript">
        getPager = function(total) {
            $("#pager").Pager({
                totalRecord: total,
                proxyUrl: '/Product/ListLabel',
                showMode: 'full'
            });
        };
        $(document).ready(function() {
            getAjax('/Product/CountLabel', function(msg) { getPager(msg); });
            onRemove = function(flag) {
                if (flag == "true") {//debugger;
                    getAjax('/Product/CountLabel', function(msg) { getPager(msg); });
                }
                //alert("fds");
            }
            $("#ex2trigger").bind("click", function() {
                $('#ex3b').jqm({ ajax: '/Product/LabelAdd/', trigger: false, target: 'div.jqmAlertContent',
                    overlay: 0
                }).jqmShow();
            });
            LabelDel = function(id) {
                $.ajax(
                {
                    type: "get",
                    url: "/Product/LabelDel/" + id,
                    success: function() { getAjax('/Product/CountLabel', function(msg) { getPager(msg); }); },
                    error: function(msg) { alert("请求失败或超时，请稍后再试！" + msg); }
                });
            };
            LabelUpdate = function(id) {
                $('#ex3b').jqm({ ajax: '/Product/LabelAdd/' + id, trigger: false, target: 'div.jqmAlertContent',
                    overlay: 0
                }).jqmShow();
            };
            UpdateLabel = function() {
                getAjax('/Product/GetTaobaoLabel', function(msg) { getAjax('/Product/CountLabel', function(msg) { getPager(msg); }); });
            }
        });
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <table border="0" cellspacing="0" cellpadding="0" width="100%" class="small">
        <tr>
            <td style="height: 2px">
            </td>
        </tr>
        <tr>
            <td style="padding-left: 10px; padding-right: 50px" class="moduleName" nowrap>
                宝贝管理 >
                <%=Html.ActionLink("分类管理","Label","Prodcut") %>
            </td>
            <td width="100%" nowrap>
                <table border="0" cellspacing="0" cellpadding="5">
                    <tr>
                        <td style="padding-right: 0px; padding-left: 10px;">
                        
                            <a href="javascript:void(0)"  title="添加分类" id="ex2trigger">
                                <img src="/Content/Images/btnL3Add.gif" border="0" alt="添加宝贝" id="ImageAddProduct" />
                            </a><a href="javascript:void(0)" onclick="UpdateLabel()">更新</a>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="height: 2px">
            </td>
        </tr>
    </table>
    <table width="98%" cellspacing="0" cellpadding="0" border="0" align="center">
        <tbody>
            <tr>
                <td valign="top">
                    <img src="/Content/Images/showPanelTopLeft.gif" />
                </td>
                <td width="100%" valign="top" style="padding: 10px;" class="showPanelBg">
                    <table width="100%" cellspacing="1" cellpadding="0" border="0" class="lvtBg">
                        <tr>
                            <td>
                                <div id="DataList"> 数据加载中...</div>
                                <textarea id="template" style="display: none">
                                    <table width="100%" class="listview" cellpadding="3" cellspacing="1">
                                        <tr>
                                        <th width="1%"><input type="checkbox" name="ListViewselectall" /></th>
                                        <th width="1%">id</th>
                                        <th>淘宝分类</th>
                                        <th>名称</th> 
                                        <th> 编辑 | 删除</th>
                                        </tr>
                                        {#foreach $T as post}
                                        <tr {#if $T.post.Cid>0} style="background-color:Gray" {#/if}>
                                        <td><input type="checkbox" value="3992" name="selected_id" /></td>
                                        <td> {$T.post.ID}</td>
                                        <td>{#if $T.post.Cid>0} 是 {#else} 否 {#/if}</td>
                                        <td>{$T.post.Name}</td>
                                        <td align="center" width="2%"><a href="javascript:void(0);" onclick="LabelUpdate({$T.post.ID})">编辑</a> | <a href="javascript:void(0);" onclick="LabelDel({$T.post.ID})">刪除</a></td>
                                        </tr>
                                        {#/for}
                                    </table>
                                </textarea>
                                <div id="pager" style="text-align: right"/>
                            </td>
                        </tr>
                    </table>
                </td>
                <td valign="top">
                    <img src="/Content/Images/showPanelTopRight.gif" />
                </td>
            </tr>
        </tbody>
    </table>
    
     
</asp:Content>
